/*
 *  Copyright (c) 2022 ZhuHai Jieli Technology Co.,Ltd.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef TWS_PAIR_H
#define TWS_PAIR_H

void tws_pair_init(void);

int tws_pair_wait_connection(int timeout);

int tws_pair_create_connection(int timeout);

int tws_pair_cancle_create_connection(void);

int tws_pair_search_sibling_by_code(int code, int timeout_ms);

int tws_pair_wait_pair_by_code(int code, const char *name);

int tws_pair_cancle_wait_pair(void);

int tws_pair_wait_connect_in_esco(void);

int tws_pair_cancle_wait_connect_in_esco(void);

void tws_pair_conntion_suss_irq(int role);

int tws_open_tws_wait_pair(u16 code, const char *name);
int tws_open_tws_wait_conn(int timeout);
int tws_open_tws_conn(int timeout);

int tws_open_phone_wait_pair(u16 code, const char *name);

int tws_close_tws_pair(void);
int tws_close_phone_wait_pair(void);

int tws_remove_tws_pairs(void);
int tws_disconnect(void);
int tws_fast_conn_with_pair(u8 role_type);

#endif
